User::select()->whereHas('student', $function($q) { $q->where('name', $value) ->orWhere('age', $value2); });